<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            width: 300px;
            height: 300px;
        }
        @media screen and (max-width: 768px) {
            .box {
                background-color: blue;
            }
            .p1 {
                display: block;
            }
            p2 {
                display: block;
            }
        }
        @media screen and (min-width: 996px) {
            .box {
                background-color: red;
            }
            p2 {
                display: none;
            }
        }
        @media screen and (min-width: 768px) and (max-width: 996px) {
            .box {
                background-color: green;
            }
            .p1 {
                display: none;
            }
        }
    </style>
</head>
<body>
<div class="box"></div>
<p class="p1">This is p1</p>
<p class="p2">This is p2</p>
</body>
</html>